package com.yiwu.common.enums;

import lombok.Data;
import lombok.Getter;

/**
 * @version 1.0
 * @description TODO
 * @date 2024/5/30 0:27
 */
@Getter
public enum MessageTypeEnum {
    CHAT(2,"文本消息"),
    MEDIA_CHAT(3,"媒体文件")
    ;


    private final Integer type;

    private final String msg;

    MessageTypeEnum(Integer type,String msg){
        this.type = type;
        this.msg = msg;
    }

    public static MessageTypeEnum getType(Integer type){
        for(MessageTypeEnum item : MessageTypeEnum.values()){
            if(item.getType().equals(type)){
                return item;
            }
        }
        return null;
    }

}
